/*
 * SecurityManager.java
 *
 * Created on May 18, 2007, 11:55 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.vce;

import com.vce.User;
import com.vce.PersistenceEngine;
/**
 *
 * @author lruiz
 */
public class SecurityManager {
    private static ThreadLocal<User> local = new ThreadLocal<User>();
    
    /** Creates a new instance of SecurityManager */
    public SecurityManager() {
    }
    
    public User getCurrentUser(){
        User user = local.get();
        return user;
    }
    
    public void setCurrentUser(User user){
        local.set(user);
    }
    
    public void clearContext(){
        local.set(null);
    }
}
